<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div {
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: red;
            left: 0px;
            transition: left 2s;
        }
        .p {
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: red;
            left: 150px;
            animation: move 3s linear -1 left;
        }
        @keyframes move{
            from{
                left: 0px;
            }
            to{
                left: 300px;
            }
        }
    </style>
</head>
<body>
    <div class="div">


    </div>
    <p class="p">

    </p>
    <script>
        var divEle = document.querySelector(".div");
        divEle.onclick = function (){
            divEle.style.left = `300px` ;
            // setTimeout(function(){
            //     console.log(11111);
            // },2000);
        }
        divEle.ontransitionend = function (){
            console.log(11111111111);
        }
        var pEle = document.querySelector(".p");
        // pEle.onclick = function (){
        //     pEle.style.left = `500px`
        // }
    </script>
</body>
</html>